package com.company.serialization;

import org.msgpack.MessagePack;
import org.msgpack.template.Templates;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @description: some desc
 * @author: ruoan
 * @date: 2021/1/1 19:00
 */
public class MsgpackTest {

    public static void main(String[] args) throws IOException {


        MessagePack messagePack = new MessagePack();
        List<String> li = new ArrayList<>();
        li.add("str1");
        li.add("str2");
        li.add("str3");
        byte[] write = messagePack.write(li);
        List<String> back = messagePack.read(write, Templates.tList(Templates.TString));
        System.out.println(back.get(0));
        System.out.println(back.get(2));
        System.out.println(back.get(1));



    }
}
